/**
 * 
 */
package exactDiagonalisation;

import static common.FSave.fSave;

/**
 * @author vladimir
 * 
 */
public class ExactDiagonalisation {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int L = 3;
		double J = 1;

		int[][] neighbors = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 },
				{ -1, -1 }, { 1, 1 } };
		String modelName = "triang_exact";

		// int[][] neighbors = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 } };
		// String modelName = "square_exact";

		// int[][] neighbors = { { -1 }, { 1 } };
		// String modelName = "chain_exact";

		double[] bRange = common.Range.range(0, 5.0, 0.1);
		// double[] bRange = { 0.1 };
		// double[] tRange = common.Range.range(0.01, 2.0, 0.01);
		double[] tRange = { 0.0001 };

		for (double B : bRange) {
			Hamiltonian H = new Hamiltonian(L, J, B, neighbors);
			for (double T : tRange) {
				System.out.println();
				System.out.println("B - " + B);
				System.out.println("T - " + T);

				double tT = Math.round(1000 * T) / 1000.0d;
				double tB = Math.round(1000 * B) / 1000.0d;

				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "Energy"), "T" + tT, H.Energy(T));

				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "M"), "T" + tT, H.M(T));

				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "M2"), "T" + tT, H.M2(T));
				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "X"), "T" + tT, H.M2(T) / T);
				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "C"), "T" + tT, H.C(T));
				fSave(common.PathJoin.pathJoin("results", modelName, "J_" + J,
						"B_" + tB, "L_" + L, "Entropy"), "T" + tT, H.Entropy(T));
			}
		}
	}
}